package com.ruoyi.merchant.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.merchant.api.domain.Merchant;
import com.ruoyi.merchant.api.factory.RemoteMerchantFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;

/**
 * 用户服务
 * 
 * @author ruoyi
 */
@FeignClient(contextId = "remoteMerchantService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteMerchantFallbackFactory.class)
public interface RemoteMerchantService
{

    /**
     * 查询商户管理列表
     *
     * @param merchant
     * @return
     */
    @GetMapping("/merchant/list")
    public R<TableDataInfo> list(@RequestParam("merchant") Merchant merchant);

    /**
     * 根据商户mId获取商户管理详细信息
     *
     * @param mId
     * @return
     */
    @GetMapping(value = "/merchant/{mId}")
    public AjaxResult getInfo(@PathVariable("mId") Long mId);

    /**
     * 查询已审核且未被删除的商户列表
     *
     * @return
     */
    @GetMapping("/merchant/selectPassedAndNotDelMerchantList")
    public R<TableDataInfo> selectPassedAndNotDelMerchantList( @RequestBody Merchant merchant);

    /**
     * 获取正在营业的商户列表
     *
     * @param merchant
     * @return
     */
    @GetMapping("/selectOpeningMerchantList")
    public R<TableDataInfo> selectOpeningMerchantList(@RequestBody Merchant merchant);
    /**
     * 查询已通过审核的商户列表
     *
     * @return
     */
    @GetMapping("/merchant/passedList")
    public R<TableDataInfo> PassedMerchantsList(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping(value = "/{smId}")
    public AjaxResult selectServiceManagementBySmId(Long smId);
}
